package com.wanxi;

public class CompareArray {
    public static void main(String[] args) {
        int[] arrayOne = {1, 2, 3};
        int[] arrayTwo = {1, 2, 3};
        arrayTwo = arrayOne;

        if (arrayOne == arrayTwo) {
            System.out.println("两个数组相同，地址相同");
            return;
        }

        if (arrayOne.length == arrayTwo.length) {
            int time = 0;
            for (int i = 0; i < arrayOne.length; i++) {
                int one = arrayOne[i];
                int two = arrayTwo[i];
                if (one == two) {
                    time++;
                }
            }
            if (time == arrayOne.length) {
                System.out.println("两个数组地址不相同，长度、内容相同");
                return;
            }
            System.out.println("两个数组地址不相同，长度相同，但内容不相同");
            return;
        }

        System.out.println("两个数组不相同");
    }
}




